package com.barry.pattern.commend;

import com.barry.pattern.BaseMode;

public class Commend extends BaseMode implements Runnable{

	public Commend(String modeName) {
		super(modeName);
	}
	/**
	 * 命令模式
	 */
	static void commend() {
		Waiter girl = new Waiter();
		Chef chefBoy = new Chef();
		Order order1 = new Order("炸鸡");
		Order order2 = new Order("炸土豆");
		Order order3 = new Order("烤西瓜");
		//girl为订单设置执行者 chefBoy
		girl.addOrder(order1, chefBoy);
		girl.addOrder(order2, chefBoy);
		girl.addOrder(order3, chefBoy);
		girl.notice();
	}
	@Override
	public void run() {
		commend();
	}

}
